package com.grm.task.manager.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@AllArgsConstructor
@Getter
public enum TaskTypeEnum {
    // 高
    HIGH(3,10),
    // 中
    MIDDLE(2,6),
    // 低
    LOW(1,3),
    // 未知
    UNKNOWN(-1,0),
    ;
    public int taskType;
    public int maxJobCount;

    public static int queryMaxJobCountByTaskType(int taskType){
        int maxJobCount = TaskTypeEnum.UNKNOWN.getTaskType();
        TaskTypeEnum[] taskTypeEnums = values();
        for (TaskTypeEnum taskTypeEnum : taskTypeEnums) {
            if(taskTypeEnum.getTaskType() == taskType){
                maxJobCount = taskTypeEnum.getMaxJobCount();
                break;
            }
        }
        return maxJobCount;
    }
}
